Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQE: improve performance of subqueries when the parent query is a range query with many steps #9719

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Oct 23, 2024

What this PR does

This PR is a follow-up PR to #9664.

This PR improves the performance of subqueries when the parent query is a range query with many steps.

It does this by changing the behaviour of the ring buffer implementations to search forwards through the buffer to find the end of the range when a subquery is being evaluated, rather than backwards. Searching backwards makes sense for range vector selectors, where there is expected to only be one point, if any, at the end of the buffer outside the range, but for subqueries in range queries it is expected that there will be many points at the end of the buffer outside the range, so it is usually faster to search from the beginning of the buffer.

Leaving this as a draft for now while I investigate a regression for the benchmark results for range vector selectors.

Which issue(s) this PR fixes or relates to

#9664

Checklist

  • Tests updated.
  • [n/a] Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • [n/a] about-versioning.md updated with experimental features.

@charleskorn charleskorn force-pushed the charleskorn/mqe-subquery-optimisation branch from 6fc4fe2 to de410ca Compare October 25, 2024 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant